﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace Core.Rules
{
    public class NoReplies_Rule : IRule
    {
        //Check if there are any replies at all in the html page given
        //Return a negative confidence if no replies at all
        public double apply(SiteEnum site, QuestionInformation info)
        {
            if (info.Replies.Count == 0) return -1; // there no replies - return negative infinity

            foreach (var reply in info.Replies)
            {
                if (reply.Author != info.Question.Author) return 0; // some reply by other person - no changes to our decision making process
            }

            return 0; // only the author replied to the question. May contain useful info, but not very likely. TODO: weight for this return???          
        }

        public string RuleName
        {
            get { return "NoReplies_Rule"; }
        }
    }
}
